home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Code Resources / ColourBlock CDEF / ColourBlock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-17  |  1.3 KB  |  48 lines  |  [TEXT/R*ch]

  1. /*    NAME:
  2.         ColourBlock.h
  3.  
  4.     WRITTEN BY:
  5.         Dair Grant
  6.         grantd@dcs.gla.ac.uk
  7.                 
  8.     DESCRIPTION:
  9.         Header file for ColourBlock.c.
  10.  
  11.     ___________________________________________________________________________
  12. */
  13. #ifndef __COLOURBLOCK__
  14. #define __COLOURBLOCK__
  15. //=============================================================================
  16. //        Defines                                                                 
  17. //-----------------------------------------------------------------------------
  18. #ifndef PackRGB
  19. #define PackRGB(col, r, g, b)        col.red=r; col.green=g; col.blue=b
  20. #endif
  21.  
  22.  
  23. // Pushes most registers onto the stack, and puts a copy of the address of main into A4.
  24. // Should be called at start of stand-alone code resource to get access to it's globals.
  25. #define GetGlobals()        asm {                                                     \
  26.                                 move.l         A4, -(SP)        ; save old A4            \
  27.                                 lea         main, A4         ; get globals            \
  28.                                 }
  29.  
  30.  
  31. // The converse of GetGlobals(). Restore the value of A4                        
  32. #define UngetGlobals()        asm {                                                    \
  33.                                 move.l         (SP)+, A4        ; restore A4 from stack    \
  34.                                 }
  35.  
  36.  
  37.  
  38. //=============================================================================
  39. //        Structures                                                                 
  40. //-----------------------------------------------------------------------------
  41. #pragma once
  42. typedef struct {
  43.     RGBColor    blockColour;
  44. } CDEFStruct, *CDEFStructPtr, **CDEFStructHnd;
  45.  
  46.  
  47. #endif
  48.